const path = require("path");

function resolve(dir) {
    return path.join(__dirname, dir);
}
// npm install path
module.exports = {
    publicPath: "./",
    // 清除全局的console.log()
    chainWebpack: (config) => {
        config.resolve.alias
            .set("@", resolve("./src"));
        config.optimization.minimizer('terser').tap((args) => {
            args[0].terserOptions.compress.drop_console = true
            return args
        });
    },
    css: {
        loaderOptions: {
            sass: {
                // 8版本用prependData:
                prependData: `
              @import "@/styles/variables.scss";  // scss文件地址
              @import "@/styles/mixin.scss";     // scss文件地址
            `
            }
        }
    }
};